/********************************************************************************
 *      Copyright:  (C) 2014 None
 *                  All rights reserved.
 *
 *       Filename:  inputpanel.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(06/06/2014)
 *         Author:  yanshifu <469718937@qq.com>
 *      ChangeLog:  1, Release initial version on "06/06/2014 07:19:28 AM"
 *                 
 ********************************************************************************/

#ifndef     _INPUTPANEL_H
#define     _INPUTPANEL_H

#include <QWidget>
#include <QtCore>
#include <QtGui>
#include <QtNetwork>
#include <QCloseEvent>
#include <QMessageBox>

namespace Ui {

    class Form;
}


struct sock_rfid
{
    unsigned char flag;
    unsigned char card_id[2];
    unsigned char senu[4];
    unsigned char sector_key_a[16];
    unsigned char addr;
    unsigned char block_buf[16];
};

class inputpanel : public QWidget
{
    Q_OBJECT

    public:
        inputpanel(QWidget *parent = 0);
        ~inputpanel();

        void displayname();
        void Csocket();
        
        void closeEvent(QCloseEvent *event);
    private slots:
        void pointClicked();
        void clearClicked();
        void payClicked();
        void receive();
        void displayError(QAbstractSocket::SocketError);
        void zeroClicked();
        void oneClicked();
        void twoClicked();
        void threeClicked();
        void fourClicked();
        void fiveClicked();
        void sixClicked();
        void sevenClicked();
        void eigthClicked();
        void nineClicked();

    private:
        Ui::Form *ui;
        int port;
        QHostAddress *hostaddr;
        QTcpSocket *clientsocket;
        struct sock_rfid CardInfo;

        double m_EditFee;
        double m_EditMoney;
        double m_EditPay;

};

#endif
